<!DOCTYPE html>
<html lang="en">
<head>
  <title>浩然企业级管理平台</title>
  <meta charset="utf-8">
  <meta content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0"
        name="viewport">
  <#include "/common/csslib.html">
</head>
<body>
<div class="main-wrapper">
  <!-- start: MAIN CONTAINER -->
  <div class="main-container inner">
    <!-- start: PAGE -->
    <div class="main-content">
      <div class="container">

        <div class="form-horizontal  h-form-warp">
          <form action="/act/model/deploy" class="form-horizontal" id="chooseCategoryForm" method="post" role="form">
            <input id="id" name="id" type="hidden" value="${modelId!}"/>
            <div class="form-group">
              <@PageDict dict_name="category" dict_desc="流程分类" dict_key="act_category" dict_value=""
              dict_type="select" label_class="col-sm-2 control-label text-right" dict_class="col-sm-4"
              required="required" />
              <label class="col-sm-2 control-label"></label>
            </div>
          </form>
        </div>
      </div>
    </div>
    <!-- end: PAGE -->
  </div>
  <!-- end: MAIN CONTAINER -->
</div>

<#include "/common/jslib.html">
<!-- 弹窗下拉 -->
<script type="text/javascript">
    $(function () {
        var api = frameElement.api;
        var W = api.opener;
        // 页面操作类型：add(添加)-edit(编辑)-view(查看)
        // 弹出窗体控制
        ActDeModelMgr = {
            // 初始化
            init: function () {
                api.button({
                    id: 'cancel',
                    name: '关闭',
                    callback: function () {
                        //api.close();
                    }
                });
                api.button({
                    id: 'ok',
                    name: '确定部署',
                    callback: ActDeModelMgr.deployModel
                });
            },
            // init end
            // 提交数据
            submitForm: function () {
                Jmts.ajaxSubmit(document.getElementById("chooseCategoryForm"), function (result) {
                    if (result.success) {
                        W.Jmts.succTips(result.msg);
                        W.location.reload();
                    } else {
                        Jmts.warnTips(result.msg);
                    }
                });
                return false;
            },
            // submitForm end
            returnIndex: function () {
                window.location.href = "/actDeModel/query";
            },
            //流程部署
            deployModel: function () {
                ActDeModelMgr.submitForm();
                return false;
            }
        };
        // 执行初始化
        ActDeModelMgr.init();
        // 前台验证表单
        $("#chooseCategoryForm").validate();
    });
</script>
</body>
</html>
